package com.hry.sunflower.job;

import com.hry.sunflower.service.BaseGpsService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * 模拟GPS定位器发送数据
 */
public class SyncGpsData extends QuartzJobBean {

    @Autowired
    private BaseGpsService baseGpsService;

    private static final Logger LOGGER = LoggerFactory.getLogger(SyncGpsData.class);

    /**
     * 模拟数据写入数据库
     *
     * @param jobExecutionContext
     * @throws JobExecutionException
     */
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        LOGGER.info("同步开始");
        try {
//            baseGpsService.addGpsData();
        } catch (Exception e) {
            LOGGER.error("Exception", e);
        }
        LOGGER.info("同步结束");

    }

}
